package org.hzandyy.framework.liteflow.script;

import com.yomahub.liteflow.script.annotation.ScriptBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author hz
 * @since 2023/12/8 16:43
 */
@Service
// includeMethodName 未生效
@ScriptBean(includeMethodName = {"call", "fun"})
@Slf4j
public class ScriptService {

    private final CustomService customService;

    public ScriptService(CustomService customService) {
        this.customService = customService;
    }

    public void call(String msg) {
        log.info("script msg: '{}'", msg);
    }

    public void fun() {
        customService.fun();
    }

    public void funWithout() {
        log.info("script不允许调用");
    }

}
